﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LessonMarket.ascx.cs" Inherits="TeachingAffairsManagementSystem.UserControl.RightContent.Student.LessonMarket" %>
<%@ Register Src="~/WebControl/AlertBox.ascx" TagPrefix="uc1" TagName="AlertBox" %>

<uc1:AlertBox runat="server" ID="Alert"/>
<div id="search">
    <div class="form-group">
        <div class="input-group">
            <asp:TextBox ID="TBSearch" runat="server" CssClass="form-control"></asp:TextBox>
            <div class="input-group-btn">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">查询 <span class="caret"></span></button>
                <ul class="dropdown-menu">
                    <li>
                        <asp:LinkButton ID="LBSearchAll" runat="server" OnClick="LBSearchAll_Click">全部</asp:LinkButton>
                    </li>
                    <li>
                        <asp:LinkButton ID="LBSearchL_ID" runat="server" OnClick="LBSearchL_ID_Click">课程ID</asp:LinkButton>
                    </li>
                    <li>
                        <asp:LinkButton ID="LBSearchName" runat="server" OnClick="LBSearchName_Click">课程名称</asp:LinkButton>
                    </li>

                </ul>
            </div>

        </div>
    </div>
</div>

<div id="gridview">
    <asp:GridView ID="GVLessonMarket" runat="server" AutoGenerateColumns="False" DataKeyNames="l_id,teacher_t_id" DataSourceID="LessonDataSource" OnRowCommand="GVLesson_OnRowCommand" AllowPaging="True" AllowSorting="True" ShowHeaderWhenEmpty="True" CssClass="table table-bordered table-hover">
        <Columns>
            <asp:BoundField DataField="l_id" HeaderText="课程ID" ReadOnly="True" SortExpression="l_id"/>
            <asp:BoundField DataField="teacher_t_id" HeaderText="teacher_t_id" SortExpression="teacher_t_id" ReadOnly="True" Visible="False"/>
            <asp:BoundField DataField="name" HeaderText="课程名称" SortExpression="name"/>
            <asp:BoundField DataField="t_name" HeaderText="教师名称" SortExpression="t_name"/>
            <asp:BoundField DataField="info" HeaderText="课程信息" SortExpression="info"/>
            <asp:BoundField DataField="finished" HeaderText="已结束" SortExpression="finished"/>
            <asp:BoundField DataField="create_time" HeaderText="创建时间" SortExpression="create_time"/>
            <asp:ButtonField CommandName="SelectLesson" Text="加入课程"/>
        </Columns>
    </asp:GridView>
</div>
<asp:SqlDataSource ID="LessonDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:sitedbConnectionString %>" ProviderName="<%$ ConnectionStrings:sitedbConnectionString.ProviderName %>"
                   SelectCommand="SELECT * FROM view_lesson WHERE finished='否'">
</asp:SqlDataSource>